/*
 * DB2BindParam object defines the needed conversion of bind parameters
 * Copyright (C) 2003 Johnathan Ingram, jingram@rogueware.org
 *
 * This library is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU Lesser General Public
 *   License as published by the Free Software Foundation; either
 *   version 2.1 of the License, or (at your option) any later version.
 *
 *   This library is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *   Lesser General Public License for more details.
 *
 *   You should have received a copy of the GNU Lesser General Public
 *   License along with this library; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  US
 *
 */

#ifndef __DB2L_BINDPARAM_H__
#define __DB2L_BINDPARAM_H__

#include <string>

#include "baseValue.h"

#include "sqlcli1.h"


using namespace std;


class DB2BindParam : public BaseValue
{
private: 
   // Internal values used to store translated Base Values for DB2 bind parameters
   SQLINTEGER        _strlenIndPtr;

   long int          _db2LongInt;
   unsigned long int _db2ULongInt;
   unsigned char     _db2Bool;
   TIMESTAMP_STRUCT  _db2TimeStamp;
   DATE_STRUCT       _db2Date;   
   TIME_STRUCT       _db2Time;

public:
 
   /* Constructor.
    *
    */
   DB2BindParam(
         const string& bindName)
         : BaseValue(bindName) 
   { };

   
   /* Returns the DB2 "C" bind paramter type based on the base value type stored
    *
    * @return   Returns the DB2 "C" type required for the value stored
    *
    */
   SQLSMALLINT
   getDB2CType();
   

   /* Returns a DB2 compliant pointer for the bind parameter
    *
    * @return   Returns the a pointer to the data stored by the parameter
    *
    */
   SQLPOINTER
   getDB2DataPointer();
   
   
   /* Returns the length of the DB2 compliant data 
    *
    * @return   Returns the length of the data.
    *
    */
   SQLINTEGER
   getDB2DataPointerLength();


   /* Returns the required StrLenIndPtr value
    *
    * @return   Returns the StrLenIndPtr value.
    *
    */
   SQLINTEGER*
   getDB2StrLenIndPtr();

};


#endif
